home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.text;
-
- import java.awt.Component;
- import java.awt.Point;
- import java.awt.event.ActionEvent;
-
- class DefaultEditorKit$BeginLineAction extends TextAction {
- private boolean select;
-
- DefaultEditorKit$BeginLineAction(String var1, boolean var2) {
- super(var1);
- this.select = var2;
- }
-
- public void actionPerformed(ActionEvent var1) {
- JTextComponent var2 = ((TextAction)this).getTextComponent(var1);
- if (var2 != null) {
- try {
- int var3 = var2.getCaretPosition();
- int var4 = Utilities.getRowStart(var2, var3);
- if (this.select) {
- var2.moveCaretPosition(var4);
- } else {
- var2.setCaretPosition(var4);
- }
-
- var2.getCaret().setMagicCaretPosition((Point)null);
- } catch (BadLocationException var5) {
- ((Component)var2).getToolkit().beep();
- }
- }
-
- }
- }
-